import VueRouter from 'vue-router'

//导入对应的路由组件
import home from './components/tabbar/home.vue'
import member from './components/tabbar/member.vue'
import shopcar from './components/tabbar/shopcar.vue'
import search from './components/tabbar/search.vue'
import newslist from './components/news/newslist.vue'
import newsinfo from './components/news/newsinfo.vue'
import photolist from './components/photos/photolist.vue'
import photoinfo from './components/photos/photoinfo.vue'
import shop from './components/shop/shop.vue'
import goodsinfo from './components/shop/goodsinfo.vue'
import goodsecs from './components/shop/goodsecs.vue'
import goodscomment from './components/shop/goodscomment.vue'

var router=new VueRouter({
    routes:[//配置路由规则
        {path:'/',redirect:'/home'},
       {path:'/home',component:home},
       {path:'/member',component:member},
       {path:'/shopcar',component:shopcar},
       {path:'/search',component:search},
       {path:'/home/newlist',component:newslist},
       {path:'/home/newsinfo/:forward',component:newsinfo},
       {path:'/home/photolist',component:photolist},
       {path:'/home/photoinfo/:forward',component:photoinfo},
       {path:'/home/shop',component:shop},
       {path:'/home/goodsinfo/:comment',component:goodsinfo,name:'goodsinfo'},
       {path:'/home/goodsecs',component:goodsecs,name:'goodsecs'},
       {path:'/home/goodscomment',component:goodscomment,name:'goodscomment'}
    ],
    linkActiveClass:'mui-active'//覆盖默认路由高亮的类 给router-link 添加一个类 
})


//暴露
export default router